package jrdcom.com.jrdmovie.Fragment;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import jrdcom.com.jrdmovie.R;

/**
 * Created by dhcui on 2017/3/26.
 */

public class MainFragment extends Fragment {
    public static final String TAG = MainFragment.class.getSimpleName();//this.getClass().getSimpleName();
    @Bind(R.id.textView)
    TextView textView;
    @Bind(R.id.textView2)
    TextView textView2;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.layout_main_fragment, container,false);

        ButterKnife.bind(this, v);
        return v;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }

    @OnClick({R.id.textView, R.id.textView2})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.textView:

                break;
            case R.id.textView2:
                getFragmentManager()
                        .beginTransaction()
                        .replace(R.id.activity_main_RL, new TopMovieFragment())
                        .addToBackStack(TopMovieFragment.TAG)
                        .commit();
                break;
        }
    }
}
